package com.application.lucky.widget.popupwindow;

import android.app.ActionBar;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.BitmapDrawable;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.PopupWindow;
import android.widget.TextView;

import com.application.lucky.R;
import com.application.lucky.activity.AddFriendsActivity;

public class HomeAddPop extends PopupWindow implements View.OnClickListener {
    private Context context;
    private View conentView;

    public HomeAddPop(Context context) {
        super(context);
        this.context = context;
        initView();
    }

    private void initView() {
        LayoutInflater inflater = (LayoutInflater) context
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        if (inflater != null) {
            conentView = inflater.inflate(R.layout.pop_home_add_layout, null);
        }

        if (conentView != null) {
            conentView.findViewById(R.id.fl).setOnClickListener(this);
        }
        this.setWidth(ActionBar.LayoutParams.WRAP_CONTENT);
        this.setHeight(ActionBar.LayoutParams.WRAP_CONTENT);
        this.setFocusable(true);
        this.setBackgroundDrawable(new BitmapDrawable());
//        this.setAnimationStyle(R.style.popwin_add_product_style);
        this.setOutsideTouchable(true);
        setContentView(conentView);

        setAnimationStyle(R.style.closeAnim);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.fl:
                context.startActivity(new Intent(context, AddFriendsActivity.class));
                dismiss();
                break;
        }
    }


}
